package trucaso;
/*
 * Card Class. Not much to say here 
 */

import java.awt.image.BufferedImage;

public class Card {
	protected int value; //The card's absolute value
	protected int envidoValue; //Value for envido
	protected int number; //Card number
	protected char type; //Card type, e,p,o or c
	protected BufferedImage img; //The card's Graphics
	protected static BufferedImage cardBack; //The Back Pattern
	protected boolean visible; // visible means img is displayed, otherwise cardBack is displayed
	protected boolean inGame; //This is to prevent duplicate cards in game 
	
	
	protected Card(int num,int v,int ev,char t,BufferedImage i) {
		number = num;
		value = v;
		envidoValue = ev;
		type = t;
		img = i;
		visible = false;
		inGame = false;
	}
	
	//Returns the Graphics for the back of the card
	protected static BufferedImage getCardBack() {
		return cardBack;
	}
	
	//Returns the card's graphics
	protected BufferedImage getCard() {
		return img;
	}

	//Sets a new card back
	protected static void setCardBack(BufferedImage cardBack) {
		Card.cardBack = cardBack;
	}
	
	protected void setNumber(int n) {
		number = n;
	}
	
	protected int getNumber() {
		return number;
	}

	//Checks whether the card is in game or not
	protected boolean isInGame() {
		return inGame;
	}
	
	//Setter for inGame
	protected void setInGame(boolean isInGame) {
		inGame = isInGame;
	}

	//Checks whether the card's Graphics are being displayed or the card back 
	protected boolean isVisible() {
		return visible;
	}

	//Setter for visible
	protected void setVisible(boolean isVisible) {
		visible = isVisible;
	}

	//Get the card's absolute value
	protected int getValue() {
		return value;
	}
	
	protected int getEnvidoValue() {
		return envidoValue;
	}

	//Setter for value
	protected void setValue(int v) {
		value = v;
	}
	
	protected void setEnvidoValue(int e) {
		envidoValue = e;
	}
	
}
